const joi = require('joi')

// id: '4',
// username: 'teacher',
// nickname: 'pig22',
// email: 'pig@aaa.com'

// const username = joi.string().alphanum().min(3).max(12).required()
const id = joi.number().integer().min(1).required()
const nickname = joi.string().alphanum().min(2).max(24).required()
const email = joi.string().email().required()

exports.update_user_schema = {
    // 对 post的请求体进行校验
    body: {
        id,
        nickname,
        email,
    }
}

const avatar = joi.string().dataUri().required()

exports.update_avatar_schema = {
    body: {
        avatar,
    }
}